﻿$(function ()
{
	$("[data-js-tree-enabled='true']").each(function (index, obj)
	{
		var $this = $(obj);
		var plugins = $this.data("jsTreePlugins");
		var coreConfig = $this.data("jsTreeCore");
		var typesConfig = $this.data("jsTreeTypes");
		var onNodeSelectFunction = $this.data("jsTreeOnNodeSelect");

		$this.jstree({
			"plugins": plugins,
			"core": coreConfig,
			"types": typesConfig,
		});


		$this.bind("select_node.jstree", function (e, data)
		{
			return window[onNodeSelectFunction](e, data);
		});
	});


});